package server

import (
	"log"
	"os"
)

// HelloWorld 模拟处理逻辑
func HelloWorld(req Request, res Response) string {
	path := req.Path
	log.Println("HelloWorld:" + path)
	//作业点1 接受客户端的写入的header
	value := req.getHeaderValue("my-header")
	log.Println("my-header :" + value)
	//作业点2 读取环境变量 VERSION，写入response header
	version := os.Getenv("VERSION")
	res.AddHead("VERSION", version)
	//作业点4 返回200状态码
	res.Code("200")
	return "hello clinet"
}

